<table class="table table-hover">
    <thead>
        <tr>
            @if(\Encore\Admin\Facades\Admin::user()->can('os-ba.box-in.trans'))
                <th><input type="checkbox" class="grid-select-all" /></th>
            @endif
            <th>批次号</th>
            <th>箱号</th>
            <th>FNSKU</th>
            <th>账号</th>
            <th>仓库</th>
            <th>站点</th>
            <th>国家</th>
            <th>产品SKU</th>
            <th>品类</th>
            <th>箱数</th>
            <th>单箱数量</th>
            <th>数量</th>
            <th>产品名称</th>
            <th>入库时间</th>
            <th>长(CM)</th>
            <th>宽(CM)</th>
            <th>高(CM)</th>
            <th>重(KG)</th>
            <th>追踪号</th>
        </tr>
    </thead>
    <tbody>
        @foreach($paginator as $row)
            <tr>
                @if(\Encore\Admin\Facades\Admin::user()->can('os-ba.box-in.trans'))
                    <td><input type="checkbox" class="grid-row-checkbox" data-id="{{ $row->id }}" /></td>
                @endif
                <td>{{ $row->batch_no }}</td>
                <td>{{ $row->box_no }}</td>
                <td>{{ $row->fnsku }}</td>
                <td>{{ \App\Models\Basics\SysPlatAccount::getAccountById($row->account_id) }}</td>
                <td>{{ $row->warehouse->w_code ?? '' }}</td>
                <td>{{ $row->area->area ?? '' }}</td>
                <td>{{ \App\Models\Basics\SysCountry::getCountryById($row->warehouse->country_id ?? 0) }}</td>
                <td>{{ $row->sku->psku_code ?? '' }}</td>
                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ $row->skuClassify->title ?? '' }}</span></td>
                <td>{{ $row->storage_total - $row->out_total }}</td>
                <td>{{ $row->num_per_box }}</td>
                <td>{{ ($row->storage_total - $row->out_total) * $row->num_per_box }}</td>
                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ $row->sku->psku_cn ?? '' }}</span></td>
                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ $row->storage_at }}</span></td>
                <td>{{ $row->delivery_box->long ?? '' }}</td>
                <td>{{ $row->delivery_box->wide ?? '' }}</td>
                <td>{{ $row->delivery_box->high ?? '' }}</td>
                <td>{{ $row->delivery_box->weight ?? '' }}</td>
                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ $row->tracking_no }}</span></td>
            </tr>
        @endforeach
    </tbody>
</table>
<script language="JavaScript" type="text/javascript">
    $(function () {
        $('.grid-select-all').iCheck({checkboxClass:'icheckbox_minimal-blue'});
        $('.grid-select-all').on('ifChanged', function(event) {
            if (this.checked) {
                $('.grid-row-checkbox').iCheck('check');
            } else {
                $('.grid-row-checkbox').iCheck('uncheck');
            }
        });
        $('.grid-row-checkbox').iCheck({checkboxClass:'icheckbox_minimal-blue'}).on('ifChanged', function () {
            if (this.checked) {
                $(this).closest('tr').css('background-color', '#ffffd5');
            } else {
                $(this).closest('tr').css('background-color', '');
            }
        });
    });
</script>
